

import java.util.Scanner;

public class SwitchDemo {

	public static void main(String[] args) {

		int count = 3;
		Scanner scanner = new Scanner(System.in);
		while (count > 0) {

			switch (count) {
			case 1:
				System.out.println("the count is : one");
				break;
			case 2:
				System.out.println("the count is : two");
				break;
			case 3:
				System.out.println("the count is : three");
				break;
			case 4:
				System.out.println("the count is :four");
				break;
			case 5:
				System.out.println("the count is : five");
				break;
			default:
				System.out.println("the count is : something else");

			}
			
			count = scanner.nextInt();
			

		}
		
		System.out.println("*************************");
		System.out.println("Now input a string to test swith with string input, type \"bye\" to exit");
		
		String input ="hello";
		
		while(!input.equalsIgnoreCase("bye")){
			switch(input){
				
				case "hello":
					System.out.println("you said hello");
					break;
				case "morning":
					System.out.println("you said morning");
					break;
				case "afternoon":
					System.out.println("you said afternoon");
					break;
				default:
					System.out.println("you said something else");
					
			}
			input = scanner.next();
		}
		scanner.close();

	}

}
